package com.itcam.project.manager;

import com.itcam.iahcommon.enums.ErrorCode;
import com.itcam.iahcommon.exception.BusinessException;
import com.itcam.project.client.BotClient;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class AiManager {
    @Resource
    private BotClient botClient;

    public String doChat(String message) {
        try {
            return botClient.doChat(message);
        } catch (BusinessException e) {
            throw e;
        } catch (Exception e) {
            throw new BusinessException(ErrorCode.SYSTEM_ERROR, "AI服务调用失败");
        }
    }
}